﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="CompleteTransit.aspx.cs" Inherits="Admin_CompleteTransit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:Panel ID="panelScan" runat="server">
        <div style="text-align: center;">
            <h1>Complete the Package's Transit</h1>
            <asp:Label ID="Label1" runat="server" Text="Receipt Number:"></asp:Label>
            <asp:TextBox ID="txtBarcode" runat="server" AutoPostBack="True" Width="496px" OnTextChanged="txtBarcode_TextChanged"></asp:TextBox>
            <br />
            <br />
            <asp:Label ID="lblError" runat="server" ForeColor="Red" Text=""></asp:Label>
            <br />
            <br />
            <asp:Button ID="btnCheck" runat="server" Text="Complete Transit" OnClick="btnCheck_Click" />
        </div>
    </asp:Panel>

    <asp:Panel ID="panelTransit" runat="server">
        <asp:DataList ID="dlPackage" runat="server" Width="100%" OnItemDataBound="dlPackage_ItemDataBound">
            <ItemTemplate>
                <div class="box_simple">
                    <div style="height: 64px; display: block;">
                        <asp:Image runat="server" ID="imgPackage" ImageUrl="~/Image/package.png" Width="40px" Style="float: left; margin-right: 20px;" />
                        <h1>Package Info </h1>
                    </div>



                    <div style="margin-left: 10px;">
                        <span class="name">Parcel Type:</span>
                        <asp:Label ID="lblParcelType" runat="server" Text='<%# Eval("ParcelType") %>'></asp:Label>

                    </div>
                    <div style="margin-left: 10px;">
                        <span class="name">Is Fragile:</span>
                        <asp:Label ID="lblFragile" runat="server" Text='<%# Eval("Fragile") %>'></asp:Label>
                    </div>

                    <div class="important">
                        <span class="name">Weight:</span>
                        <asp:Label ID="lblWeight" runat="server" Text='<%# String.Format("{0:00.00} Kg", Eval("Weight")) %>'></asp:Label>
                    </div>
                    <div class="important">
                        <span class="name">Price:</span>
                        <asp:Label ID="lblPrice" runat="server" Text='<%# String.Format("${0:00.00}", Eval("Price")) %>'></asp:Label>
                    </div>
                    <hr />
                    <div style="margin-left: 10px; margin-top: 25px;">
                        <span>The package is</span><asp:Label class="important" Style="color: #00ff21" ID="lblStatus" runat="server" Text='<%# Eval("Status") %>'></asp:Label>
                        <br />
                        <br />

                    </div>
                </div>
                <%-- <div class="box_transit_senderinfo">
                    <div class="name">
                        <asp:Label ID="lblSenderName" runat="server" Text='<%# Eval("Sender") %>'></asp:Label>
                    </div>
                    <div class="from">
                        <asp:Label ID="lblFrom" runat="server" Text='<%# Eval("SenderLocation") %>'></asp:Label>
                    </div>
                </div>--%>
                <div class="box_transit">
                    <div class="branch_name">
                        <asp:Label ID="Label3" runat="server" Text='<%# String.Format("Sender: {0}",Eval("Sender")) %>'></asp:Label>
                    </div>
                    <div class="branch_address">
                        <asp:Label ID="Label4" runat="server" Text='<%# Eval("SenderLocation") %>'></asp:Label>
                    </div>
                    <div class="branch_status">
                        <asp:Label ID="Label5" runat="server" Text='<%# Eval("Status").ToString()!="Pending" ? "Sent out" : "To be Confirmed" %>'></asp:Label>
                    </div>
                </div>
                <div>
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/Image/go-down.png" Width="50px" Style="margin-left: 60px;" />
                </div>
                <asp:DataList ID="dlTransit" runat="server" Width="100%">
                    <ItemTemplate>
                        <div class="box_transit">
                            <div class="branch_name">
                                <asp:Label ID="lblBranch" runat="server" Text='<%# Eval("CurrentBranch") %>'></asp:Label>
                            </div>
                            <div class="branch_address">
                                <asp:Label ID="lblAddress" runat="server" Text='<%# Eval("CurrentAddress") %>'></asp:Label>
                            </div>
                            <div class="branch_status">
                                <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("Status").ToString()=="1" ? "Arrived" : "Pending" %>'></asp:Label>
                            </div>
                        </div>
                        <div>
                            <asp:Image ID="Image1" runat="server" ImageUrl="~/Image/go-down.png" Width="50px" Style="margin-left: 60px;" />
                        </div>
                    </ItemTemplate>
                </asp:DataList>
                <div class="box_transit">
                    <div class="branch_name">
                        <asp:Label ID="lblBranch" runat="server" Text='<%# String.Format("Receiver: {0}",Eval("Receiver")) %>'>></asp:Label>
                    </div>
                    <div class="branch_address">
                        <asp:Label ID="lblAddress" runat="server" Text='<%# Eval("ReceiverLocation") %>'></asp:Label>
                    </div>
                    <div class="branch_status">
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("Status").ToString()!="Completed" ? "Pending" : "Package Received" %>'></asp:Label>
                    </div>
                </div>
            </ItemTemplate>
        </asp:DataList>
    </asp:Panel>
</asp:Content>

